﻿/*
  Copyright (c) 2011, Mikheev Rostislav
  Copyright (c) 2011, FreshFarsh team

  Steel Engine source code is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
/**
  @author Mikheev Rostislav <hacenator@gmail.com>
  @date 13.03.2011
  @brief Common header file
*/

#ifndef STEEL_COMMON_H_
#define STEEL_COMMON_H_

#include "stddef.h"

/// Steel version
const char STEEL_VERSION[4] = {0, 0, 1, 0};

/// Steel namespace defination
#define _STEEL_NAMESPACE steel

/// A macro to disallow the copy constructor and operator= functions
/// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
  TypeName(const TypeName&);               \
  void operator=(const TypeName&)

/** Configuration parameters name */
//TODO: it is must be moved somwhere else
/// Application window width
#define CONFIG_PARAMETER_WINDOWS_WIDTH "wnd_width"
/// Application window height
#define CONFIG_PARAMETER_WINDOWS_HEIGHT "wnd_height"
/// Application window switcher fullscreen/windowed
#define CONFIG_PARAMETER_WINDOWS_FULLSCREEN "wnd_fulscreen"
 /// OpenGL FSAA Samples
#define CONFIG_PARAMETER_OPENGL_MULTISAMPLE "gl_multisample"

/* singletones shorthands */
//TODO(hacenator) auto include "log.h" and "config.h" with this shorthands
#define sConfig Config::GetInstance()
#define sLog Log::GetInstance()

//********************************************
//            Debug settings
//********************************************
#ifdef DEBUG

//#warning "Project compiled in DEBUG mode"

#define _STEEL_LOG_FILE "debug.log"
#define LOG_INFO(...) _console->Infof(__VA_ARGS__);
#define LOG_WARN(...) _console->Warnf(__VA_ARGS__);
#define LOG_ERROR(...) _console->Errorf(__VA_ARGS__);

// TODO(hacenator): Using of "Default Value" macroses is not suitable.
// default configuration
#define CONFIG_DEFAULT_WINDOWS_WIDTH 800
#define CONFIG_DEFAULT_WINDOWS_HEIGHT 600
#define CONFIG_DEFAULT_WINDOWS_FULLSCREEN 0
#define CONFIG_DEFAULT_OPENGL_MULTISAMPLE 0

//********************************************
//            Release settings
//********************************************
#else

//#warning "Project compiled in Release mode"

#define _STEEL_LOG_FILE "game.log"
#define LOG_INFO(...) // info is not logged in release
#define LOG_WARN(...) _console->Warnf(__VA_ARGS__);
#define LOG_ERROR(...) _console->Errorf(__VA_ARGS__);

// default configuration
#define CONFIG_DEFAULT_WINDOWS_WIDTH 1024
#define CONFIG_DEFAULT_WINDOWS_HEIGHT 768
#define CONFIG_DEFAULT_WINDOWS_FULLSCREEN 1
#define CONFIG_DEFAULT_OPENGL_MULTISAMPLE 0

#endif

#endif
